package com.example.usercenter.service;

import com.example.usercenter.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.usercenter.model.request.UserSearchRequest;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 86138
* @description 针对表【user】的数据库操作Service
* @createDate 2024-08-26 14:35:32
*/
public interface UserService extends IService<User> {


    /**
     * 用户注册
     * @param account
     * @param password
     * @param checkPassword
     * @return
     */
    long register(String account,String password,String checkPassword);

    /**
     * 用户登录
     * @param account
     * @param password
     * @return
     */
    User login(String account, String password, HttpServletRequest request);

    /**
     * 根据用户名搜索
     * @param userSearchRequest
     * @return
     */
    List<User> search(UserSearchRequest userSearchRequest);

    /**
     * 获取当前的用户信息
     * @param request
     * @return
     */
    User getCurrentUser(HttpServletRequest request);

    /**
     * 用户退出
     * @param request
     */
    void logout(HttpServletRequest request);
}
